#include "cvupdatethread.h"

CVUpdateThread::CVUpdateThread(){

}

CVUpdateThread::CVUpdateThread(cv::VideoCapture _cap,Ui::CVDialog *_ui)
{
    this->cap = _cap;
    this->ui = _ui;
}
void CVUpdateThread::run(){
    cv::Mat frame;
    QImage img;
    for(;;){
            this->cap>>frame;
           img  = QImage( (const unsigned char*)(frame.data), frame.cols, frame.rows, QImage::Format_RGB888 );
        //    namedWindow( "Image_Show", WINDOW_AUTOSIZE );
        //    imshow( "Image_Show", src );
            ui->label->setPixmap( QPixmap::fromImage(img) );
    }
}
